using System;
using System.Collections.Generic;
using System.Text;
using System.Data.OleDb;

namespace nDeveloper.UI.Windows.IDE
{
    public class ColumnSchema : IComparable<ColumnSchema>
    {
        private string columnName;
        private string tableName;
        private OleDbType dataType;
        private string defaultValue;
        private string description;
        private int? size;
        private bool isPrimaryKey;
        private bool isNullable;
        private bool isAutoIncrement;

        public string ColumnName
        {
            get
            {
                return columnName;
            }
            set
            {
                columnName = value;
            }
        }

        public string TableName
        {
            get
            {
                return tableName;
            }
            set
            {
                tableName = value;
            }
        }

        public OleDbType DataType
        {
            get
            {
                return dataType;
            }
            set
            {
                dataType = value;
            }
        }

        public string DefaultValue
        {
            get
            {
                return defaultValue;
            }
            set
            {
                defaultValue = value;
            }
        }

        public string Description
        {
            get
            {
                return description;
            }
            set
            {
                description = value;
            }
        }

        public int? Size
        {
            get
            {
                return size;
            }
            set
            {
                size = value;
            }
        }

        public bool IsPrimaryKey
        {
            get
            {
                return isPrimaryKey;
            }
            set
            {
                isPrimaryKey = value;
            }
        }

        public bool IsNullable
        {
            get
            {
                return isNullable;
            }
            set
            {
                isNullable = value;
            }
        }

        public bool IsAutoIncrement
        {
            get
            {
                return isAutoIncrement;
            }
            set
            {
                isAutoIncrement = value;
            }
        }

        public ColumnSchema()
        {
        }

        public ColumnSchema(string columnName)
        {
            this.columnName = columnName;
        }

        #region IComparable<ColumnSchema> Members

        public int CompareTo(ColumnSchema other)
        {
            return String.Compare(this.columnName, other.columnName, StringComparison.CurrentCultureIgnoreCase);
        }

        #endregion
    }
}